package com.zy.springaop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Service;

@Aspect
@Service
public class asp {
    @Around("execution(* com.zy.springaop.UserService.*(..))")
    public void sss3(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("around1");
        pjp.proceed();
        System.out.println("around2");
    }


    @Before("execution(* com.zy.springaop.UserService.*(..))")
    public void sss(){
        System.out.println("before");
    }
    @After("execution(* com.zy.springaop.UserService.*(..))")
    public void sss2(){
        System.out.println("after");
    }
}
